{extend name="public/basic"}
{block name="main"}
{auth:button rule="home/user/add" rules="$buttons"}<button type="button" class = "layui-btn layui-btn-success" action="dialog" action-url="{:url('user/add')}" action-title="新增管理员">新增</button>{/auth:button}
<table class="layui-table">
    <thead>
        <tr>
            <th>ID</th>
            <th>用户名</th>
            <th>邮箱</th>
            <th>最后登录时间</th>
            <th>最后登录IP</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
    </thead>
    <tbody>
        {volist name="list" id="vo"}
            <tr>
                <td>{$vo.user_id}</td>
                <td>{$vo.user_name}</td>
                <td>{$vo.email}</td>
                <td>{$vo.last_login_time}</td>
                <td>{$vo.last_login_ip}</td>
                <td>{if condition="$vo['status']=='1'"}
                <span class="label label-success {if condition="$vo['user_id'] != '1'"}status{/if}" data-href="{:url('change_status_u','uid='.$vo['user_id'])}" data-status="1" data-id="{$vo.user_id}">启用</span>
                {else /}
                <span class="label label-danger status" data-href="{:url('change_status_u','uid='.$vo['user_id'])}" data-status="0" data-id="{$vo.user_id}">停用</span>
                {/if}
                </td>
                <td>{if condition="$vo['user_id'] neq '1'"}
                    {auth:button rule="home/user/edit" rules="$buttons"}<i action="dialog" action-url="{:url('edit', ['uid'=>$vo['user_id']])}" action-title="编辑" class="layui-icon layui-icon-edit"></i>{/auth:button}
                    {auth:button rule="home/user/del_u" rules="$buttons"}<i class="layui-icon layui-icon-delete" action="del" action-url="{:url('del_u',['uid'=>$vo['user_id']])}"  title="删除"></i>{/auth:button}
                    {/if}
                </td>
            </tr>
        {/volist}
    </tbody>
    <!-- tbody是必须的 -->
</table>
{$list->render()}

{/block}